<template>
  <div>
    <num-scroll :count="total"></num-scroll>

    <!-- <input type="text" v-model="count"> -->
    <!-- <el-form
      :model="numberValidateForm"
      ref="numberValidateForm"
      label-width="100px"
      class="demo-ruleForm"
    >
      <el-form-item label="年龄" prop="age" :rules="numberRules">
        <el-input type="age" v-model="numberValidateForm.age"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm('numberValidateForm')">提交</el-button>
        <el-button @click="resetForm('numberValidateForm')">重置</el-button>
      </el-form-item>
    </el-form> -->
  </div>
</template>

<script>
import numScroll from "./number";
export default {
  components: { numScroll },
  data() {
    return {
      count: 12345,
      total:349,
      numberValidateForm: {
        age: ""
      },
      numberRules: [
        {
          validator(rule, value, callback) {
            if (/(^[1-9]\d*$)/.test(value)) {
              callback();
            } else {
              callback(new Error("请输入正整数"));
            }
          },
          trigger: "change"
        }
      ]
    };
  },
  created() {},
  mounted() {
    // this.updateData();
  },
  methods: {
    updateData() {
      setInterval(() => {
       
        this.total = 66;
        setTimeout(() => {
          this.total = 12345;
        }, 1000);
      }, 5000);
    },
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  }
};
</script>

<style scoped lang="scss">
</style>
